package com.tj.bo.account.client.enums;

public enum WithDrawStatusEnum {
    //
    INIT(0, "init"),
    AUDIT_PROCESSING(1, "under review"),
    PAYOUT_PROCESSING(2, "Paying"),
    PAYOUT_SUCCESS(3, "payout success"),
    AUDIT_REJECT(-1, "audit reject"),
    PAYOUT_FAILED(-2, "payout failed");

    private int code;
    private String desc;

    WithDrawStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static WithDrawStatusEnum getByCode(int code) {
        WithDrawStatusEnum[] values = WithDrawStatusEnum.values();
        for (WithDrawStatusEnum value : values) {
            if (value.code == code) {
                return value;
            }
        }
        return WithDrawStatusEnum.INIT;
    }
}